/*****************************************************************************/
/* File: Renderer.h                                                          */
/* Author: Ozon                                                              */
/*                                                                           */
/* Description:																 */
/*	Class that have direct access to OpenGL device.							 */
/*****************************************************************************/
#pragma once

#include <windows.h>
#include <math.h>

#include <gl/gl.h>
#include <gl/glu.h>

#include "DrawList.h"
#include "Level.h"
#include "Camera.h"

#include "Common.h"

class CRenderer
{
private:
	
	HDC m_hDC;
	int m_iGLPixelIndex;	//index of pixel format
	HGLRC m_hGLContext;		//context of Gl device.
	

	unsigned int m_uiWidth;		//width of rendered window
	unsigned int m_uiHeight;	//height of rendered window


private:
	int SetWindowPixelFormat(HDC hDC);
	int CreateViewGLContext(HDC hDC);


public:
	CRenderer(HDC hDC, unsigned int uiWidth, unsigned int uiHeight);
	~CRenderer(void);

	int Init();
	int Destroy();

	unsigned int GetWidth(){return m_uiWidth;}
	unsigned int GetHeight(){return m_uiHeight;}

	int Draw();

};
